package com.kgo.eidtor.controller;

import com.kgo.eidtor.entity.ModuleBean;
import com.kgo.eidtor.entity.StandardBean;
import com.kgo.eidtor.service.ModuleService;
import com.kgo.eidtor.util.ResultUtil;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author keepgoon
 * @Description: TODO
 * @date 2019/1/3114:05
 */
@RestController
@CrossOrigin
public class ModuleController {
    @Resource
    private ModuleService moduleService;
    @RequestMapping(value = "/module/code" ,method = RequestMethod.GET,produces="text/plain;charset=UTF-8")
    public String getModuleCode(ModuleBean module){
        return moduleService.getModuleCode();
    }
    @RequestMapping(value = "/module" ,method = RequestMethod.POST,produces="text/plain;charset=UTF-8")
    public String addModule(ModuleBean module){
        return moduleService.addModule(module);
    }
    @RequestMapping(value = "/modules" ,method = RequestMethod.GET,produces="text/plain;charset=UTF-8")
    public String getModules(ModuleBean module){
        return moduleService.getModules(module);
    }
    @RequestMapping(value = "/module/id" ,method = RequestMethod.GET,produces="text/plain;charset=UTF-8")
    public String getModuleById(String id){
        return moduleService.getModuleById(id);
    }
}